package com.fansl.allround.auth.endpoint;

import com.fansl.allround.auth.dto.ClientDTO;
import com.fansl.allround.auth.service.AllroundClientDetailsService;
import com.fansl.allround.common.core.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fansl
 * @Description: 客户端-控制器
 * @date 2019/10/30 14:15
 */
@RestController
@RequestMapping("/oauth/client")
public class ClientsController {
    @Autowired
    private AllroundClientDetailsService allroundClientDetailsService;

    @PostMapping("/insert")
    public R<ClientDetails> insert(@RequestBody ClientDTO clientDTO) {
        ClientDetails clientDetails =
                allroundClientDetailsService.insert(clientDTO);
        return new R<>(clientDetails);
    }
}
